package com.sqsf.util;

import com.sqsf.javabean.Role;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

@RunWith(SpringRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class JDBCTest {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @Test
    public void jdbc(){
        String sql="insert into role (name,`desc`)values(?,?)";
        //执行操作
        int row = jdbcTemplate.update(sql, "aaa", "对对对对");
        System.out.println(row);
    }

}
